package com.iraeta.controller;

import com.alibaba.fastjson.JSONObject;
import com.iraeta.entity.IraOrderScStep;
import com.iraeta.service.iraorder.IraOrderScStepService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * 订单的生产步骤维护功能
 * */
@RestController(value = "IraOrderScStepController")
@RequestMapping("emp/orderscstep")
public class IraOrderScStepController extends BaseController{
    @Resource
    IraOrderScStepService iraOrderScStepService;

    @RequestMapping("listorderstep")
    public String listOrdrStep(@RequestBody JSONObject paramJb){
        int orderId = paramJb.getIntValue("id");
        List<IraOrderScStep> stepList = iraOrderScStepService.listIraOrderScStep(orderId);
        return this.success(stepList);
    }

    @RequestMapping("deleteorderstop")
    public String deleteOrdrStep(@RequestBody JSONObject paramJb){
        int id = paramJb.getIntValue("id");
        this.iraOrderScStepService.deleteIraOrderScStep(id);
        return this.success();
    }
}
